/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package FrameSekretariat;

import Database.UserPenerimaTable;
import Database.UserSekreTable;
import Model.UserPenerima;
import Model.UserSekre;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTable;

/**
 *
 * @author admin
 */
public class FrameDaftarUser extends JFrame{
    private JTable tableUser;
    private JButton buttonOk;
    private ArrayList<UserPenerima> data;

    public FrameDaftarUser(ArrayList<UserPenerima> data) {
        this.setTitle("Daftar User Penerima");
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        this.setBounds(400, 200, 400, 400);
        this.setLayout(null);
        this.data = data;
        
        tableUser = new JTable();
        tableUser.setBounds(20, 20, 350, 290);
        tableUser.setModel(new UserPenerimaTable(data));
        this.add(tableUser);

        buttonOk = new JButton("OK");
        buttonOk.setBounds(150, 325, 80, 30);
        this.add(buttonOk);
        buttonOk.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
            }
        });
    }
    
    public ArrayList<UserPenerima> getData() {
        return data;
    }

    public void setData(ArrayList<UserPenerima> data) {
        this.data = data;
    }
}
